{extend name="public:_base" /}
{block name="js"}
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui/css/H-ui.min.css"/>
<script src="__STATIC__/hanbang/js/jquery.min.js"></script>
<!--验证-->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/Validform/v5.3.2/Validform_v5.3.2_min.js"></script>

<script type="text/javascript">
    $("#form").Validform({
        tiptype: 3,
        label: ".form-label",
        ajaxPost: true,
        showAllError: true,
        callback: function (data) {
            if (data.status == "y") {
                setTimeout(function () {
                    window.location.reload();
                }, 1000);
            } else {
                setTimeout(function () {
                    $.Hidemsg(); //公用方法关闭信息提示框;显示方法是$.Showmsg("message goes here.");
                }, 1000);
                $("#captcha").click();
                $("[name='captcha']").val('');
            }

        }
    });
</script>
{/block}
{block name="main"}

<form name="" method="post" action="{:url('massage/save')}" id="form">
    <table class="table table-bordered nobottommargin">
        <thead>
        <tr style="background: #ddd;">
            <th colspan="2" style="padding: 20px 0px;text-indent: 10px;">提交留言</th>
        </tr>
        </thead>

        <tbody>
        <tr>
            <td><label class="form-label "><span class="c-red">*</span>标题</label></td>
            <td><input type="text" id="form-title" name="title" value="" datatype="*"
                       class="form-control"></td>
        </tr>
        <tr>
            <td><label class="form-label "><span class="c-red">*</span>称呼</label></td>
            <td><input type="text" id="form-name" name="name" value="" datatype="*"
                       class="form-control"></td>
        </tr>
        <tr>
            <td><label class="form-label ">电话</label></td>
            <td><input type="number" id="form-tel" name="tel" value=""
                       class="form-control"></td>
        </tr>
        <tr>
            <td><label class="form-label ">Email</label></td>
            <td><input type="email" id="form-mail" name="mail" value=""
                       class="form-control"></td>
        </tr>
        <tr>
            <td><label class="form-label ">其他联系方式</label></td>
            <td><input type="text" id="form-address" name="other" value=""
                       class="form-control" placeholder="如QQ, MSN等"></td>
        </tr>
        <tr>
            <td><label class="form-label "><span class="c-red">*</span>内容</label></td>
            <td>
                <textarea name="center" cols="58" rows="7" tabindex="4" class="sm-form-control" datatype="*" style="border: 1px solid #cccccc;border-radius: 3px !important;"></textarea>
            </td>
        </tr>
        <tr>
            <td><label class="form-label "><span class="c-red">*</span>验证码</label></td>
            <td><input type="text" name="captcha" value="" datatype="*"
                       class="form-control">
                <img id="captcha" src='{:captcha_src()}'
                     onclick='this.src = "{:captcha_src()}"' alt='验证码'
                     title='看不清验证码，点击刷新!'/></td>
        </tr>
        </tbody>

        <tfoot>
        <tr>
            <th style="border-right: 0px;"></th>
            <th style="border-left: 0px;">
                <input class="btn btn-success radius size-L" type="submit"
                       value="提交留言"/>
                <input type="reset" class="btn btn-default radius size-L"
                       value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
            </th>
        </tr>
        </tfoot>
    </table>
</form>
{/block}
